using UnityEngine;
using Utility.GameEvents.Core;

namespace Utility.GameEvents.Examples {
    public class PlayerScoreManager : MonoBehaviour {
        public string playerId = "Player1";
        private int _currentScore = 0;

        public void AddScore(int amount) {
            _currentScore += amount;
            EventBus.Raise<PlayerScoreChangedEvent>(new PlayerScoreChangedEvent(playerId, _currentScore, amount));
        }

        [ContextMenu("Add Score")]
        void TestAddScore() {
            AddScore(Random.Range(1,10));
        }
    }
}